<p>如果一个<code> Serializable </code>对象在其继承链中有不可序列化的父类时，该不可序列化的父类必须要有一个无参构造函数。</p>
<h2>不规范代码示例</h2>
<pre>
public class Fruit {
  private Season ripe;

  public Fruit (Season ripe) {...}
  public void setRipe(Season ripe) {...}
  public Season getRipe() {...}
}

public class Raspberry extends Fruit 
        implements Serializable {  // 不合规；不可序列化的祖先没有no-arg构造函数
  private static final long serialVersionUID = 1;

  private String variety;

  public Raspberry(Season ripe, String variety) { ...}
  public void setVariety(String variety) {...}
  public String getVarity() {...}
}
</pre>

<h2>正确代码示例</h2>
<pre>
public class Fruit {
  private Season ripe;

  public Fruit () {...}; //符合标准； 父类有no-arg构造函数
  public Fruit (Season ripe) {...}
  public void setRipe(Season ripe) {...}
  public Season getRipe() {...}
}

public class Raspberry extends Fruit 
        implements Serializable {
  private static final long serialVersionUID = 1;

  private String variety;

  public Raspberry(Season ripe, String variety) {...}
  public void setVariety(String variety) {...}
  public String getVarity() {...}
}
</pre>
